#ifndef ROMANNUMERAL_H
#define ROMANNUMERAL_H

#include "Number.h"
#include <string>

class RomanNumeral : public Number
{
public:
	RomanNumeral();
	RomanNumeral(std::string n);
	~RomanNumeral() {};

	int toInteger() const;
    std::string toRomanNumeral() const;
	std::string toWordNumber() const;

	bool operator>(const RomanNumeral& rhs) const;
	bool operator<(const RomanNumeral& rhs) const;
	bool operator>=(const RomanNumeral& rhs) const;
	bool operator<=(const RomanNumeral& rhs) const;
	bool operator==(const RomanNumeral& rhs) const;
	bool operator!=(const RomanNumeral& rhs) const;

	RomanNumeral operator+(const RomanNumeral& rhs) const;
	RomanNumeral operator-(const RomanNumeral& rhs) const;
	RomanNumeral operator*(const RomanNumeral& rhs) const;
	RomanNumeral operator/(const RomanNumeral& rhs) const;
	RomanNumeral operator%(const RomanNumeral& rhs) const;

private:
    int integer;
    std::string word;
	std::string roman;

	virtual bool parse();
	int toIntegerOperation(std:: string s);
	std::string toWordNumberOperation(std:: string s);

	int charPointer;
	std::string tempRoman;

	bool startState();
	bool MState();
	bool DState();
	bool CState(int repeat);
	bool LState();
	bool XState(int repeat);
	bool VState();
	bool IState(int repeat);
	bool MPostCState();
	bool DPostCState();
	bool CPostXState();
	bool LPostXState();
	bool XPostIState();
	bool VPostIState();
	bool IState();	
};

#endif
